<template>
	<div>
		<ElTable v-loading="loading" :data="proinfo" style="width: 100%;" height="60vh" empty-text="没有数据"
		    :border="true">
			<ElTableColumn prop="Id" label="ID" width="80"></ElTableColumn>
			<ElTableColumn prop="BusinessId" label="业务Id" width="80px"></ElTableColumn>
			<ElTableColumn prop="ProcessName" label="流程名称" width="90px"></ElTableColumn>
			
			<ElTableColumn prop="Order" label="流程顺序" width="90"></ElTableColumn>
			<ElTableColumn prop="CreateTime" label="创建时间" width="180px"></ElTableColumn>
			<ElTableColumn prop="Status" label="状态" width="120px">
				<template #default="scoped">
					{{ IsStatus(scoped.row.Status) }}
				</template>
			</ElTableColumn>
		</ElTable>
	</div>
</template>

<script setup lang="ts">
	import { ElFormItem, ElInput, ElForm, ElButton, FormInstance, ElMessage } from 'element-plus';
	import { onMounted, reactive, ref } from 'vue';
	import processapi from '@/api/processapi';

	const IsStatus = ((status : any) => {
		let statustext = "正常"
		switch (status) {
			case 0:
				statustext = "删除"
				break;
			case -1:
				statustext = "异常"
				break;
		}
		return statustext
	})

	const props = defineProps({
		Id: Number,
	})
	const emits = defineEmits(['onSave'])
	const loading = ref(true)
	const proinfo=ref([])
	// const data = reactive({
	// 	proinfo: []
	// })
	
function getdata(){
	processapi.query({BusinessId:props.Id}).then(res => {
		proinfo.value = res.data;
		console.log("res.data=",res.data)
		loading.value = false;
	}).catch(err => {
		loading.value = false;
		console.log(err)
	})
}	
	
	onMounted(()=>{
		getdata()
	})
	
</script>

<style scoped>
</style>